<template>
  <div class="maintenance_examine">
    <Row class="delivery_create_info">
      <Form inline
            ref="formValidate"
            :model="formValidate"
            :rules="ruleValidate"
            :label-width="120"
            style="width: 850px;">
        <div class="title"><span></span>基本信息</div>
        <FormItem prop="shopId"
                  label="选择门店：">
          <treeselect :options="options"
                      @select="selectListd"
                      class='input-wid'
                      :clearable="clearable"
                      :disable-branch-nodes="true"
                      style='width:260px'
                      :normalizer="normalizer"
                      noResultsText="未搜索符合的门店"
                      noOptionsText="门店为空"
                      placeholder="请选择门店"
                      v-model='formValidate.shopId' />
        </FormItem>
        <FormItem prop="dh"
                  label="维修单号：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="手机号：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="维修单号：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="发起人：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="申报时间：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="故障等级：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="对应故障：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <Row style="height:80px;"></Row>
        <div class="title"><span></span>机台信息</div>
        <FormItem prop="dh"
                  label="故障机台：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="资产编码：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="游戏位：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="维修部位：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="数量：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="单位：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="机台供应商：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <FormItem prop="dh"
                  label="是否延期：">
          <Input v-model="formValidate.dh"
                 style="width:260px"
                 placeholder="请输入" />
        </FormItem>
        <Row>
          <FormItem>
            <Button type="primary"
                    class="btn"
                    style="margin-right: 24px;width:100px;"
                    @click="submitForm">确认</Button>
            <Button class="btn"
                    style="width:100px;"
                    @click="reset">取消</Button>
          </FormItem>
        </Row>
      </Form>
    </Row>
  </div>
</template>
<script>
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { getOrgAllTree } from '@/api/system/org'
export default {
  name: 'maintenance_examine',
  components: { Treeselect },
  data () {
    return {
      formValidate: {
        shopId: null,
        dh: ''
      },
      options: [],
      clearable: false,
      normalizer (node) {
        return {
          id: node.id,
          label: node.orgName,
          children: node.childList && node.childList.length ? node.childList : undefined
        }
      },
      ruleValidate: {

      }
    }
  },
  mounted () {
    this.getOrg()
  },
  methods: {
    getOrg () {
      getOrgAllTree({
        'merchantId': this.$store.state.user.merchantId,
        'orgType': 1,
        status: 1,
        perms: 'moms:assets:receiptview'
      }).then(res => {
        if (res.data.status === 200) {
          this.options = [res.data.data]
        } else {
          this.$Message.error(`${res.data.error}`)
        }
      })
    },
    selectListd () {

    },
    submitForm () {

    },
    reset () {

    }
  }
}
</script>
<style lang="less" scoped>
.maintenance_examine {
  .delivery_create_info {
    width: 850px;
    margin: auto;
  }
  .title {
    font-size: 14px;
    color: #464c5b;
    letter-spacing: 0;
    line-height: 20px;
    margin: 24px 0;
    padding-left: 40px;
    > span {
      display: inline-block;
      width: 8px;
      height: 20px;
      vertical-align: top;
      background: #2d8cf0;
      margin-right: 10px;
    }
  }
}
</style>
